home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / minix / update~4.z / update~4 / lib_stdio_test_tfwrite.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-06  |  367 b   |  28 lines

  1. #include <stdio.h>
  2.  
  3. main()
  4.  
  5. {
  6. #ifdef __STDC__
  7.   void *malloc(unsigned int);
  8.   void exit(int);
  9. #else
  10.   void *malloc();
  11.   void exit();
  12. #endif
  13.   char *b;
  14.   int i;
  15.  
  16.   if ((b = malloc(48*1024)) == 0) {
  17.     fputs("No memory for buffer\n", stderr);
  18.     exit(1);
  19.   }
  20.  
  21.   for (i = 0; i < 100; i++)
  22.     fwrite(b, 1023, 1, stdout);
  23.  
  24.   fwrite(b, 1023, 48, stdout);
  25.  
  26.   return 0;
  27. }
  28.